<template>
	<view class="main">
		<header-vue :back="true" title="我的发布"></header-vue>
		<view class="flex between order-type select-box font30">
			<view class="item" v-for="(item, index) in orderType" :class="{active: orderIndex == index}"
				@click="orderIndex = index">{{item}}</view>
		</view>
		<view class="flex star font28 tab">
			<view v-for="(item, index) in typeList" class="flex column" :class="{active: typeIndex == index}"
				@click="typeIndex = index">
				<view>{{item.name}}</view>
				<i class="iconfont icon-tab-circle"></i>
			</view>
		</view>
		<llqVue v-if="!orderIndex"></llqVue>
		<llxVue v-if="orderIndex == 1"></llxVue>
		<hdqVue v-if="orderIndex == 2"></hdqVue>
		<gxzVue v-if="orderIndex == 3"></gxzVue>
	</view>
</template>

<script>
	import headerVue from '../../components/header.vue';
	import llqVue from './publicCom/llq.vue';
	import llxVue from './publicCom/llx.vue';
	import hdqVue from './publicCom/hdq.vue';
	import gxzVue from './publicCom/gxz.vue';

	export default {
		components: {
			headerVue,
			llqVue,
			llxVue,
			hdqVue,
			gxzVue
		},
		data() {
			return {
				imageUrl: '~@static/shop/',
				typeIndex: 0,
				orderIndex: 0,
				orderType: ['邻里圈', '邻里讯', '活动墙', '逛闲置'],
				typeList: [{
						name: '审核通过'
					},
					{
						name: '待审核'
					},
					{
						name: '已驳回'
					}
				],
				selectShow: false,
				showFilter: false,
				params: {
					keyword: '',
					type: ''
				}
			}
		},
		methods: {
			goPage(url) {
				uni.navigateTo({
					url
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		background: #F6F6F6;
	}

	.margin32 {
		margin: 0 32rpx;
	}

	.search-box {
		height: 72rpx;
		background: $uni-bg-color;
		border-radius: 60rpx;
		padding: 0 28rpx;
		margin-bottom: 28rpx;
		width: 100%;

		.iconfont {
			color: $uni-text-color-grey;
			margin-right: 20rpx;
		}

		.input {
			width: 100%;
			height: 100%;
			color: $uni-text-color-grey;
		}
	}

	.scroll-x {
		padding: 28rpx 0;
		box-sizing: border-box;
		border-radius: 20rpx;
		white-space: nowrap;
		width: auto;

		.type {
			padding: 0 20rpx;
			box-sizing: border-box;
			height: 48rpx;
			background: #EEEEEE;
			border-radius: 60rpx;
			color: $uni-text-color-grey;
			margin-right: 28rpx;

			&:nth-child(1) {
				margin-left: 32rpx;
			}
		}

		.active {
			color: $uni-text-color-inverse;
			background: $uni-color-primary;
			font-weight: 500;
		}

		.next-btn {
			width: 62rpx;
			height: 48rpx;
			position: absolute;
			right: 0;
		}
	}

	.price {
		color: $uni-text-color-red;
		align-items: baseline;
	}

	.select-box {
		position: relative;
		background: $uni-bg-color;
		box-sizing: border-box;

		.select-modal {
			width: 100vw;
			position: absolute;
			z-index: 10;
			background: $uni-bg-color;
			border-radius: 0rpx 0rpx 28rpx 28rpx;
			left: -32rpx;
			top: 100%;
			margin-top: 8rpx;
			padding: 28rpx 32rpx;
			box-sizing: border-box;

			.select-modal-item {
				margin-top: 40rpx;
				color: $uni-text-color-grey1;

				&:nth-child(1) {
					margin: 0;
				}
			}

			.radio {
				width: 26rpx;
				height: 26rpx;
				border-radius: 50%;
				border: 1rpx solid $uni-color-primary;
			}

			.active {
				color: $uni-text-color;

				.radio {
					background: $uni-color-primary;
					color: $uni-text-color-inverse;
				}
			}
		}
	}

	.order-type {
		padding: 20rpx 32rpx;

		.item {
			color: $uni-text-color-grey1;
			height: 42rpx;
			position: relative;
		}

		.active {
			font-weight: 500;
			font-size: 32rpx;
			color: $uni-text-color;

			&:before {
				content: '';
				width: 32rpx;
				height: 6rpx;
				background: #0785CF;
				border-radius: 20rpx;
				position: absolute;
				bottom: -20rpx;
				left: 50%;
				transform: translate(-50%, 0);
			}
		}
	}

	.tab {
		color: $uni-text-color-grey1;
		margin: 28rpx 0;

		.column {
			margin-right: 60rpx;
		}

		.icon-tab-circle {
			width: 26rpx;
			height: 12rpx;
			margin-top: 6rpx;
			font-size: 12rpx;
			color: $uni-text-color-inverse;
		}

		.active {
			color: $uni-text-color;
			font-size: 30rpx;
			font-weight: 500;

			.icon-tab-circle {
				color: $uni-color-primary;
			}
		}
	}
</style>